﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace dotnet_lab3
{

    public class BaseClass
    {
        public virtual void Foo()
        {
            Console.WriteLine("Base");
        }
    }
    public class Overrider : BaseClass
    {
        public override void Foo()
        {
            Console.WriteLine("Overrider");
        }
    }
    public class Hider : BaseClass
    {
        public new void Foo()
        {
            Console.WriteLine("Hider");
        }
    }


    class Program
    {
        static void Main(string[] args)
        {

            Overrider over = new Overrider();
            BaseClass b1 = over;
            over.Foo();             // Overrider.Foo
            b1.Foo();            // Overrider.Foo
            Hider hider = new Hider();
            BaseClass b2 = hider;
            hider.Foo();            // Hider.Foo
            b2.Foo();            // BaseClass.Foo 

            Console.ReadLine();

        }
    }

}